<%@page import="java.util.List"%>
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
	<head>
		<title>会议详情</title>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="format-detection" content="telephone=no">
		<meta name="description" content="北京规划院 移动办公 OA 自动化">
		<link rel="stylesheet" type="text/css" href="${base}/css/weui.min.css" />
		<link rel="stylesheet" type="text/css" href="${base}/css/font-awesome-4.7.0/css/font-awesome.css" />
		<%
		    String userid=(String)request.getAttribute("loginuser");		   
		%>
		<style>
			#toLeft {
				border: 10px solid #FFF;
				border-right-color: #F00;
			}
			
			a {
				color: #000;
			}
			
			select option {
				padding-left: 10px;
			}
			
			.weui-cells {
				font-size: 0.9em;
				height: 1;
				margin-top: 0;
			}
			
			.weui-cell {
				padding: 7px 15px;
			}
			
			.weui-cell__hd i {
				width: 15px;
				text-align: center;
				height: 100%;
				margin-right: 5px;
			}
			
			.weui-media-box__info__meta {
				font-size: 12px;
				color: #10AEFF;
				cursor: pointer;
			}
			
			.weui-media-box__info {
				width: 240px;
				margin: 15px auto;
			}
		</style>
	</head>

	<body ontouchstart>
		<div class="weui-panel weui-panel_access">
			<div class="weui-cells">
				<div class="weui-cell">
					<div class="weui-cell__hd"><label for="" class="weui-label">会议主题</label></div>
					<div class="weui-cell__bd">
						<input class="weui-input" value="" disabled="" placeholder="" id="topic">
					</div>
				</div>
				<div class="weui-cell">
					<div class="weui-cell__hd"><label for="" class="weui-label">开始时间</label></div>
					<div class="weui-cell__bd">
						<input class="weui-input" value="" disabled="" placeholder="" id="begintime">
					</div>
				</div>
				<div class="weui-cell">
					<div class="weui-cell__hd"><label for="" class="weui-label">结束时间</label></div>
					<div class="weui-cell__bd">
						<input class="weui-input" value="" disabled="" placeholder="" id="finishtime">
					</div>
				</div>
				<div class="weui-cell">
					<div class="weui-cell__hd"><label for="" class="weui-label">会议地点</label></div>
					<div class="weui-cell__bd">
						<input class="weui-input" value="" disabled="" placeholder="" id="roomname">
					</div>
				</div>
			</div>
		</div>
		<div class="weui-cells" style="margin-top: 10px;">
			<div class="weui-cell">
				<div class="weui-cell__hd"><label for="" class="weui-label">主持人</label></div>
				<div class="weui-cell__bd">
					<input class="weui-input" value="" disabled="" placeholder="" id="zcr">
				</div>
			</div>
		</div>
		<div class="weui-cells">
			<div class="weui-cell">
				<div class="weui-cell__hd"><label for="" class="weui-label">发起人</label></div>
				<div class="weui-cell__bd">
					<span disabled="" id="fqr" class="weui-textarea" rows="3" style="background: #fff;font-size: 1em;font-family: -apple-system-font,Helvetica Neue,sans-serif"></span>
				</div>
			</div>
		</div>
		<div class="weui-cells">
			<div class="weui-cell">
				<div class="weui-cell__hd"><label for="" class="weui-label">参与人</label></div>
				<div class="weui-cell__bd">
					<span disabled="" id="cyr" class="weui-textarea" rows="3" style=" background: #fff;font-size: 1em;font-family: -apple-system-font,Helvetica Neue,sans-serif"></span>
				</div>
			</div>
		</div>
		<div class="weui-cells">
			<div class="weui-cell">
				<div class="weui-cell__hd"><label for="" class="weui-label">备注信息</label></div>
				<div class="weui-cell__bd">
					<span id="meetbz" class="weui-textarea" rows="3" style=" background: #fff;font-size: 1em;font-family: -apple-system-font,Helvetica Neue,sans-serif"></span>
				</div>
			</div>
		</div>
		<div class="weui-flex">
			<div class="weui-flex__item" id="comeBack" style="margin: 5% 10px;">
				<div class="placeholder">
					<a href="javascript:;" class="weui-btn weui-btn_default">返回</a>
				</div>
			</div>
			<div class="weui-flex__item"  style="margin: 5% 10px;display:none" id="mark">
				<div class="placeholder">
					<a href="javascript:;" class="weui-btn weui-btn_primary" >编辑该会议</a>
				</div>
			</div>
		</div>
		<script src="${base}/js/jquery-1.11.3.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
		<script src="https://res.wx.qq.com/open/libs/weuijs/1.0.0/weui.min.js"></script>
		<script type="text/javascript">
			function parseURL(url) {
				if(url.indexOf("?") == -1) return
				var url = url.split("?")[1];
				var res = [];
				if(url.indexOf("&") == -1) {
					var arr = url.split("=");
					res[arr[0]] = arr[1]
				} else {
					var arr = url.split("&");
					for(var i = 0; i < arr.length; i++) {
						var key = arr[i].split("=");
						res[key[0]] = key[1]
					}
				}
				return res
			}
			var url2 = window.location.href;
			url2 = decodeURIComponent(url2)
			var res = parseURL(url2)
			$.ajaxSettings.async = false;
			var userid='<%=userid %>';
			var username;
			$.ajaxSettings.async = false;
			$.post("userIdToName",{userid:userid},function(data){
					username=data.res;					
			})
			$.ajaxSettings.async = false;
			$.post("/meet/meetinfoQuery", {    //根据会议序号查询其信息
				xh: res.xh
			}, function(data) {
				console.log(data.ydrname.indexOf(username))
				if(data.ydrname.indexOf(username)!=-1){
					var time=data.mc.starttime;  //处理开始时间
					var day1=time.slice(0,10);
					var date1=day1.split("-")[2]
					var hour1=time.slice(11).split(":")[0];
					
					var myDate = new Date();  //获取当前时间  
					var date = myDate.getDate();
					var month = myDate.getMonth() + 1;
					var year=myDate.getFullYear();
					var day2=year+'-'+month+'-'+date;
					var hour2=myDate.getHours()
					
					if(day1==day2){
						hour=hour1-hour2;
						if(hour>1){
							$("#mark").show()
						}
					}else if(date1>date){
						$("#mark").show()
					}
				}
				$("#topic").val(data.mc.topic)
				$("#begintime").val(data.mc.starttime)
				$("#finishtime").val(data.mc.finishtime)
				$("#roomname").val(data.mc.room)
				$("#zcr").val(data.zcrname)
				$("#fqr").html(data.ydrname)
				$("#cyr").html(data.chrname)
				$("#meetbz").html(data.mc.meetbz)
			})
			
			$("#comeBack").click(function(){
				history.back()
			})
			$("#mark").click(function(){
				var href = "/meet/ordernav?type=ydr&xh="+res.xh;
				location.href = href;
			})
		</script>
	</body>

</html>